﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp2
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        

        

        private void button2_Click_1(object sender, EventArgs e)
        {
            var uid = textBox1.Text;
            var pwd = textBox2.Text;
            var repwd = textBox3.Text;

            var hasUid = !String.IsNullOrEmpty(uid);
            var hasPwd = !String.IsNullOrEmpty(pwd);

            if (hasUid && hasPwd)
            {

                if (pwd == repwd)
                {
                    MessageBox.Show("注册成功");
                    Form1.users.Add(uid, pwd);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("两次输入的密码不一致！");
                }
            }
            else
            {
                MessageBox.Show("注册失败！");
            }


        }
    }
}
